import jwt from "jsonwebtoken";

export const GenerateToken = function (data) {
    const token = jwt.sign(data, "yzpt", {
        expiresIn: "3 days",
    });
    return token;
};

export const ParseAuth = (token) => {
    try {
        const verify = jwt.verify(token, "yzpt");
        return verify;
    } catch (e) {
        return "";
    }
};
